feat: Validate tiled ServiceAccount config at startup#1548
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## opa-client #1548 +/- ##
=============================================
Coverage ? 95.79%
=============================================
Files ? 44
Lines ? 3280
Branches ? 0
=============================================
Hits ? 3142
Misses ? 138
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5ed7d2e to
3b5b8a2
Compare
ddf28f2 to
403846c
Compare
c23b4d7 to
b575c2b
Compare
b575c2b to
b6049c8
Compare
|
|
||
| class OpaConfig(BlueapiBaseModel): | ||
| root: HttpUrl = HttpUrl("http://localhost:8181") | ||
| tiled_service_account_check: str |
There was a problem hiding this comment.
nit: This changes only when the policy changes so we can have a default value for it here
There was a problem hiding this comment.
It depends if we want to include diamond specific configuration as defaults? As far as I can see so far, there is nothing included so far. Would the services copier template be a better place to put the default values?
| result: bool, | ||
| context: AbstractContextManager, | ||
| ): | ||
| session.return_value.post = AsyncMock( |
There was a problem hiding this comment.
I'm writing this comment only once,But it applies to all the tests.
I personally think that pytest-aiohttp provide a better way of do this type of test. Creating so many mocks looks unnecessary/ clutters the code.
There was a problem hiding this comment.
I'm not sure how pytest-aiohttp would be used here? It appears to be targetted at testing webservers not mocking out responses.
b6049c8 to
63009c0
Compare
63009c0 to
9865265
Compare
Ensure that the tiled auth configuration is valid and fail fast instead of when the first data is written.